<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">2</attachments-count>
  <closed type="boolean">false</closed>
  <created-at type="datetime">2008-08-14T17:38:31-05:00</created-at>
  <creator-id type="integer">29039</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">5</number>
  <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
  <priority type="integer">0</priority>
  <project-id type="integer">15332</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>open</state>
  <tag>bug ie windows</tag>
  <title>using http basic authentication with IE - not working</title>
  <updated-at type="datetime">2008-09-23T07:57:10-05:00</updated-at>
  <user-id type="integer">29854</user-id>
  <user-name>Paul Gallagher</user-name>
  <creator-name>Brian Evans</creator-name>
  <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
  <original-body>This is the first time I have used RA, but when I installed and configured everything, if I use Firefox, everything works fine - I am redirected to /sessions/new and can login.  If I use IE, I can go to /sessions/new and login, but if i first go to /home which has a before_filter :login_required on the top of the controller, it doesn't redirect me to /sessions/new to login, it gives me the windows username and password screen attached.  The username and password does not work in this screen and will not work.  Not sure if this is a bug or something I am doing wrong (probably me).  I would appreciate any advice or help in fixing this.  If you need more details or any code let me know.

Thanks,

Brian</original-body>
  <latest-body>This is the first time I have used RA, but when I installed and configured everything, if I use Firefox, everything works fine - I am redirected to /sessions/new and can login.  If I use IE, I can go to /sessions/new and login, but if i first go to /home which has a before_filter :login_required on the top of the controller, it doesn't redirect me to /sessions/new to login, it gives me the windows username and password screen attached.  The username and password does not work in this screen and will not work.  Not sure if this is a bug or something I am doing wrong (probably me).  I would appreciate any advice or help in fixing this.  If you need more details or any code let me know.

Thanks,

Brian</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;This is the first time I have used RA, but when I installed and configured everything, if I use Firefox, everything works fine - I am redirected to /sessions/new and can login.  If I use IE, I can go to /sessions/new and login, but if i first go to /home which has a before_filter :login_required on the top of the controller, it doesn't redirect me to /sessions/new to login, it gives me the windows username and password screen attached.  The username and password does not work in this screen and will not work.  Not sure if this is a bug or something I am doing wrong (probably me).  I would appreciate any advice or help in fixing this.  If you need more details or any code let me know.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Brian&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>This is the first time I have used RA, but when I installed and configured everything, if I use Firefox, everything works fine - I am redirected to /sessions/new and can login.  If I use IE, I can go to /sessions/new and login, but if i first go to /home which has a before_filter :login_required on the top of the controller, it doesn't redirect me to /sessions/new to login, it gives me the windows username and password screen attached.  The username and password does not work in this screen and will not work.  Not sure if this is a bug or something I am doing wrong (probably me).  I would appreciate any advice or help in fixing this.  If you need more details or any code let me know.

Thanks,

Brian</body>
      <body-html>&lt;div&gt;&lt;p&gt;This is the first time I have used RA, but when I installed and configured everything, if I use Firefox, everything works fine - I am redirected to /sessions/new and can login.  If I use IE, I can go to /sessions/new and login, but if i first go to /home which has a before_filter :login_required on the top of the controller, it doesn't redirect me to /sessions/new to login, it gives me the windows username and password screen attached.  The username and password does not work in this screen and will not work.  Not sure if this is a bug or something I am doing wrong (probably me).  I would appreciate any advice or help in fixing this.  If you need more details or any code let me know.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Brian&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-14T17:38:31-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-14T17:38:31-05:00</updated-at>
      <user-id type="integer">29039</user-id>
      <user-name>Brian Evans</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Hmm -- I am going to be of little help debugging this since I am a mac weenie.  You may want to see if you can recruit another windows user from the [#rails IRC channel](http://www.rubyonrails.org/community) or [railsforum](http://railsforum.com/).

What server is your code running on?  Does it fail if you have your code on a remote (non-windows) machine and use IE?

Even if rest_auth somehow decided to ask IE for http basic, I don't understand why that username and password would fail. the http basic code just checks that same username/password against the DB.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hmm -- I am going to be of little help debugging this since I am a mac weenie.  You may want to see if you can recruit another windows user from the &lt;a href=&quot;http://www.rubyonrails.org/community&quot;&gt;#rails IRC channel&lt;/a&gt; or &lt;a href=&quot;http://railsforum.com/&quot;&gt;railsforum&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What server is your code running on?  Does it fail if you have your code on a remote (non-windows) machine and use IE?&lt;/p&gt;

&lt;p&gt;Even if rest_auth somehow decided to ask IE for http basic, I don't understand why that username and password would fail. the http basic code just checks that same username/password against the DB.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T08:55:04-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: &quot;&quot;
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T08:55:04-05:00</updated-at>
      <user-id type="integer">20241</user-id>
      <user-name>mrflip</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Lemme expand on the above:

* I don't understand why it's asking for basic auth in the first place.  This is supposed to be governed by the http request somehow.  See if you can look at the request and figure out why rails is being fooled.

* Also it should bounce you to try the password first.  Trace through the login_by session, cookie and password paths and see why all fail?

* Finally: why, once it has decided to ask for http basic auth, does that username and password fail?

* Are you sure it's asking for http basic auth and not some crazy windows thing?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Lemme expand on the above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I don't understand why it's asking for basic auth in the first place.  This is supposed to be governed by the http request somehow.  See if you can look at the request and figure out why rails is being fooled.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also it should bounce you to try the password first.  Trace through the login_by session, cookie and password paths and see why all fail?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally: why, once it has decided to ask for http basic auth, does that username and password fail?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are you sure it's asking for http basic auth and not some crazy windows thing?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T09:00:43-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T09:00:43-05:00</updated-at>
      <user-id type="integer">20241</user-id>
      <user-name>mrflip</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>thanks for the suggestions, I will do some more testing and see what I can find out.

I work on a mac most of the time, and everything worked fine until it went live and the client couldn't login.  That's when I found out it is an IE bug.

Is there any way to disable http basic and see what happens then?

I'll still check everything else and get back with you.</body>
      <body-html>&lt;div&gt;&lt;p&gt;thanks for the suggestions, I will do some more testing and see what I can find out.&lt;/p&gt;

&lt;p&gt;I work on a mac most of the time, and everything worked fine until it went live and the client couldn't login.  That's when I found out it is an IE bug.&lt;/p&gt;

&lt;p&gt;Is there any way to disable http basic and see what happens then?&lt;/p&gt;

&lt;p&gt;I'll still check everything else and get back with you.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T09:46:13-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T09:46:13-05:00</updated-at>
      <user-id type="integer">29039</user-id>
      <user-name>Brian Evans</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Another thing I noticed, is that if I go to domain.com/admin (which has the before_filter on it), I get the login screen, doesn't redirect me to the login script.  If I go directly to domain.com/session/new, the login screen comes up and everything works fine, I can login and access everything.  

BTW, it is hosted on hostingrails.com, so it isn't hosted on a windows environment.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Another thing I noticed, is that if I go to domain.com/admin (which has the before_filter on it), I get the login screen, doesn't redirect me to the login script.  If I go directly to domain.com/session/new, the login screen comes up and everything works fine, I can login and access everything.&lt;/p&gt;

&lt;p&gt;BTW, it is hosted on hostingrails.com, so it isn't hosted on a windows environment.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T09:48:46-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T09:48:46-05:00</updated-at>
      <user-id type="integer">29039</user-id>
      <user-name>Brian Evans</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Also, here is what is logged in the production.log.  I am not sure what &quot;filter chain halted&quot; means:

Processing DashboardController#index (for XX.XX.XX.XX at 2008-08-18 09:50:30) [GET]
  Session ID: BAh7BzoMY3NyZl9pZCIlZWEzZGNmOWUzZTJkOGMwNDM2MmNiNGM3N2JjZTVl
YTYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh
c2h7AAY6CkB1c2VkewA=--2c2e19bd4de161431e7550b22033bb4e9f187b1a
  Parameters: {&quot;action&quot;=&gt;&quot;index&quot;, &quot;controller&quot;=&gt;&quot;dashboard&quot;}
Filter chain halted as [:login_required] rendered_or_redirected.
Completed in 0.00071 (1404 reqs/sec) | Rendering: 0.00007 (10%) | DB: 0.00000 (0%) | 401 Unauthorized [http://www.domain.com/siteadmin/public/]</body>
      <body-html>&lt;div&gt;&lt;p&gt;Also, here is what is logged in the production.log.  I am not sure what &quot;filter chain halted&quot; means:&lt;/p&gt;

&lt;p&gt;Processing DashboardController#index (for XX.XX.XX.XX at 2008-08-18 09:50:30) [GET]
  Session ID: BAh7BzoMY3NyZl9pZCIlZWEzZGNmOWUzZTJkOGMwNDM2MmNiNGM3N2JjZTVl
YTYiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh
c2h7AAY6CkB1c2VkewA=--2c2e19bd4de161431e7550b22033bb4e9f187b1a
  Parameters: {&quot;action&quot;=&gt;&quot;index&quot;, &quot;controller&quot;=&gt;&quot;dashboard&quot;}
Filter chain halted as [:login_required] rendered_or_redirected.
Completed in 0.00071 (1404 reqs/sec) | Rendering: 0.00007 (10%) | DB: 0.00000 (0%) | 401 Unauthorized [&lt;a href=&quot;http://www.domain.com/siteadmin/public/&quot;&gt;http://www.domain.com/siteadmin/...&lt;/a&gt;]&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T10:02:13-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T10:02:13-05:00</updated-at>
      <user-id type="integer">29039</user-id>
      <user-name>Brian Evans</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>This is what happens when I use FireFox and access the same page - and it works - redirects me to the login page (even on windows):

Processing SessionsController#new (for XX.XX.XX.XX at 2008-08-18 10:04:01) [GET]
  Session ID: BAh7BzoOcmV0dXJuX3RvIhcvc2l0ZWFkbWluL3B1YmxpYy8iCmZsYXNoSUM6
J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2Vk
ewA=--627a7cb3ff7fcb8f63c8bcc778510f04357e4e77
  Parameters: {&quot;action&quot;=&gt;&quot;new&quot;, &quot;controller&quot;=&gt;&quot;sessions&quot;}
Rendering template within layouts/login
Rendering sessions/new
Completed in 0.00119 (841 reqs/sec) | Rendering: 0.00107 (90%) | DB: 0.00000 (0%) | 200 OK [http://www.domain.com/siteadmin/public/session/new]</body>
      <body-html>&lt;div&gt;&lt;p&gt;This is what happens when I use FireFox and access the same page - and it works - redirects me to the login page (even on windows):&lt;/p&gt;

&lt;p&gt;Processing SessionsController#new (for XX.XX.XX.XX at 2008-08-18 10:04:01) [GET]
  Session ID: BAh7BzoOcmV0dXJuX3RvIhcvc2l0ZWFkbWluL3B1YmxpYy8iCmZsYXNoSUM6
J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2Vk
ewA=--627a7cb3ff7fcb8f63c8bcc778510f04357e4e77
  Parameters: {&quot;action&quot;=&gt;&quot;new&quot;, &quot;controller&quot;=&gt;&quot;sessions&quot;}
Rendering template within layouts/login
Rendering sessions/new
Completed in 0.00119 (841 reqs/sec) | Rendering: 0.00107 (90%) | DB: 0.00000 (0%) | 200 OK [&lt;a href=&quot;http://www.domain.com/siteadmin/public/session/new&quot;&gt;http://www.domain.com/siteadmin/...&lt;/a&gt;]&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T10:05:47-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T10:05:47-05:00</updated-at>
      <user-id type="integer">29039</user-id>
      <user-name>Brian Evans</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I think filter_chain halted just refers to the before_filter that enforces logins.

I'm now mostly wondering if something different in the HTTP request is fooling rails into asking for HTTP auth. 

It falls thru to HTTP auth in lib/authenticated_system.rb:
@@@
    # Redirect as appropriate when an access request fails.
    #
    # The default action is to redirect to the login screen.
    #
    # Override this method in your controllers if you want to have special
    # behavior in case the &lt;%= file_name %&gt; is not authorized
    # to access the requested action.  For example, a popup window might
    # simply close itself.
    def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to new_&lt;%= controller_routing_name %&gt;_path
        end
        # format.any doesn't work in rails version &lt; http://dev.rubyonrails.org/changeset/8987
        # you may want to change format.any to e.g. format.any(:js, :xml)
        format.any do
          request_http_basic_authentication 'Web Password'
        end
      end
    end
@@@

Try tracing through that method and see why it makes the decision it does. Can you  dump the request and see if anything is obvs. different?  (dump with logger.error, or turn down the [log threshold](http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging)

If you don't care about having HTTP auth for bot API access, you could try (code untested, YMMV) this to disable it:
@@@
    def access_denied
      store_location
      redirect_to new_&lt;%= controller_routing_name %&gt;_path
    end
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;I think filter_chain halted just refers to the before_filter that enforces logins.&lt;/p&gt;

&lt;p&gt;I'm now mostly wondering if something different in the HTTP request is fooling rails into asking for HTTP auth.&lt;/p&gt;

&lt;p&gt;It falls thru to HTTP auth in lib/authenticated_system.rb:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
    # Redirect as appropriate when an access request fails.
    #
    # The default action is to redirect to the login screen.
    #
    # Override this method in your controllers if you want to have special
    # behavior in case the &amp;lt;%= file_name %&amp;gt; is not authorized
    # to access the requested action.  For example, a popup window might
    # simply close itself.
    def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to new_&amp;lt;%= controller_routing_name %&amp;gt;_path
        end
        # format.any doesn't work in rails version &amp;lt; http://dev.rubyonrails.org/changeset/8987
        # you may want to change format.any to e.g. format.any(:js, :xml)
        format.any do
          request_http_basic_authentication 'Web Password'
        end
      end
    end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Try tracing through that method and see why it makes the decision it does. Can you  dump the request and see if anything is obvs. different?  (dump with logger.error, or turn down the &lt;a href=&quot;http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging&quot;&gt;log threshold&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don't care about having HTTP auth for bot API access, you could try (code untested, YMMV) this to disable it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
    def access_denied
      store_location
      redirect_to new_&amp;lt;%= controller_routing_name %&amp;gt;_path
    end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T10:44:04-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T10:44:04-05:00</updated-at>
      <user-id type="integer">20241</user-id>
      <user-name>mrflip</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">20241</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Assuming it takes the wrong path thru that method, BTW, the thing to look at (as far as I know) is stuff like the MIME type of the request and the 'accepts' header.

Just to check: what version of Rails? And you are using the [latest version of restful-authentication](http://github.com/technoweenie/restful-authentication/tree/master) -- last commit was &quot;merging from nbibler&quot;?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Assuming it takes the wrong path thru that method, BTW, the thing to look at (as far as I know) is stuff like the MIME type of the request and the 'accepts' header.&lt;/p&gt;

&lt;p&gt;Just to check: what version of Rails? And you are using the &lt;a href=&quot;http://github.com/technoweenie/restful-authentication/tree/master&quot;&gt;latest version of restful-authentication&lt;/a&gt; -- last commit was &quot;merging from nbibler&quot;?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-18T10:46:57-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-08-18T10:46:57-05:00</updated-at>
      <user-id type="integer">20241</user-id>
      <user-name>mrflip</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name>mrflip</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I'm having the exact same problem.

This may help...

http://github.com/technoweenie/restful-authentication/commit/698536b9edb795c0115be9f497f50613a284212d#comments

I tried adding the following line to access_denied to no avail:
 
def access_denied
      request.format ||= :html if request.env['HTTP_USER_AGENT'] =~ /msie/i 
      ...
end

Let me know if you find/found a solution.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I'm having the exact same problem.&lt;/p&gt;
&lt;p&gt;This may help...&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/technoweenie/restful-authentication/commit/698536b9edb795c0115be9f497f50613a284212d#comments&quot;&gt;
http://github.com/technoweenie/r...&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tried adding the following line to access_denied to no
avail:&lt;/p&gt;
&lt;p&gt;def access_denied&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;  request.format ||= :html if request.env['HTTP_USER_AGENT'] =~ /msie/i
  ...
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;Let me know if you find/found a solution.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-04T22:46:49-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- 
:assigned_user: 20241
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working-2</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-04T22:46:49-05:00</updated-at>
      <user-id type="integer">31101</user-id>
      <user-name>Greg Sterndale</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>What is the value of request.format with IE, with Mozilla, etc?  From the comments there IE sends the wrong thing, which is to say it sends something, and so the request.format ||= :html will never act.  Can you instead try

@@@
def access_denied
  request.format = :html if request.env['HTTP_USER_AGENT'] =~ /msie/i
  ...
end
@@@

There is also this, added earlier this year:
  http://dev.rubyonrails.org/ticket/11140
I have no idea if it's related but that section of code is where I'd start digging.</body>
      <body-html>&lt;div&gt;&lt;p&gt;What is the value of request.format with IE, with Mozilla, etc?
From the comments there IE sends the wrong thing, which is to say
it sends something, and so the request.format ||= :html will never
act. Can you instead try&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
def access_denied
  request.format = :html if request.env['HTTP_USER_AGENT'] =~ /msie/i
  ...
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is also this, added earlier this year: &lt;a href=&quot;http://dev.rubyonrails.org/ticket/11140&quot;&gt;http://dev.rubyonrails.org/ticke...&lt;/a&gt;
I have no idea if it's related but that section of code is where
I'd start digging.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-04T23:01:04-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working-3</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-04T23:01:04-05:00</updated-at>
      <user-id type="integer">20241</user-id>
      <user-name>mrflip</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Thanks mrflip.

That's exactly where I ended up.

Another helpful link:
http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/</body>
      <body-html>&lt;div&gt;&lt;p&gt;Thanks mrflip.&lt;/p&gt;
&lt;p&gt;That's exactly where I ended up.&lt;/p&gt;
&lt;p&gt;Another helpful link: &lt;a href=&quot;http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/&quot;&gt;
http://geminstallthat.wordpress....&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-04T23:28:00-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working-4</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-04T23:28:00-05:00</updated-at>
      <user-id type="integer">31101</user-id>
      <user-name>Greg Sterndale</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I'm having the exact same problem but in this case with firefox 1.5!

   I've got a small sample app running rails 2.1 and the latest release of RA.When i go to the controller that has the before_filter call,it gives me the authentication windows instead of the regular html form.It onyl happens in firefox,goes perfectly fine on safari.I noticed that started happening after I upgraded from rails 2.0 to 2.1,so this my help you guys somehow.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I'm having the exact same problem but in this case with firefox
1.5!&lt;/p&gt;
&lt;p&gt;I've got a small sample app running rails 2.1 and the latest
release of RA.When i go to the controller that has the
before_filter call,it gives me the authentication windows instead
of the regular html form.It onyl happens in firefox,goes perfectly
fine on safari.I noticed that started happening after I upgraded
from rails 2.0 to 2.1,so this my help you guys somehow.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-08T19:26:31-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-08T19:26:37-05:00</updated-at>
      <user-id type="integer">16958</user-id>
      <user-name>alexandre (at bubble.com)</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@mrflip, I think you can actually blame this on a subtle behaviour of MimeResponds!

As far as I can see, the problem is that if I use format.any in a responds_to block, it will always catch unless the other format options (like format.html) are _specifically_ preferred by the browser (i.e. included in the HTTP_ACCEPTS header)

So using format.html/format.any is fine, as long as the browser includes text/html in the accepts header.

IE6 doesn't (and also FF1.5 according to alexendre), but that's not because its broken. According to the [HTTP RFC](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html &quot;HTTP RFC&quot;) there's no compulsion to list the specific formats you accept.

I reckon the proper fix to this is in MimeResponds, but until then I suggest the best thing for restful_authentication would be to qualify the format.any by default. 

@@@ ruby
  def access_denied
    respond_to do |format|
      format.html do
        store_location
        redirect_to new_session_path
      end
      format.any(:js, :xml) do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
@@@

This works well for me in IE and FF without resorting to browser-specific tricks, and if HTTP Auth needs to be invoked by the developer for other situations, they can override as desired.</body>
      <body-html>&lt;div&gt;&lt;p&gt;@mrflip, I think you can actually blame this on a subtle
behaviour of MimeResponds!&lt;/p&gt;
&lt;p&gt;As far as I can see, the problem is that if I use format.any in
a responds_to block, it will always catch unless the other format
options (like format.html) are &lt;em&gt;specifically&lt;/em&gt; preferred by
the browser (i.e. included in the HTTP_ACCEPTS header)&lt;/p&gt;
&lt;p&gt;So using format.html/format.any is fine, as long as the browser
includes text/html in the accepts header.&lt;/p&gt;
&lt;p&gt;IE6 doesn't (and also FF1.5 according to alexendre), but that's
not because its broken. According to the &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&quot; title=&quot;HTTP RFC&quot;&gt;HTTP RFC&lt;/a&gt; there's no compulsion to list the specific
formats you accept.&lt;/p&gt;
&lt;p&gt;I reckon the proper fix to this is in MimeResponds, but until
then I suggest the best thing for restful_authentication would be
to qualify the format.any by default.&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
  def access_denied
    respond_to do |format|
      format.html do
        store_location
        redirect_to new_session_path
      end
      format.any(:js, :xml) do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works well for me in IE and FF without resorting to
browser-specific tricks, and if HTTP Auth needs to be invoked by
the developer for other situations, they can override as
desired.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-23T07:57:02-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: bug ie windows
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-23T07:57:09-05:00</updated-at>
      <user-id type="integer">29854</user-id>
      <user-name>Paul Gallagher</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@mrflip, I think you can actually blame this on a subtle behaviour of MimeResponds!

As far as I can see, the problem is that if I use format.any in a responds_to block, it will always catch unless the other format options (like format.html) are _specifically_ preferred by the browser (i.e. included in the HTTP_ACCEPTS header)

So using format.html/format.any is fine, as long as the browser includes text/html in the accepts header.

IE6 doesn't (and also FF1.5 according to alexendre), but that's not because its broken. According to the [HTTP RFC](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html &quot;HTTP RFC&quot;) there's no compulsion to list the specific formats you accept.

I reckon the proper fix to this is in MimeResponds, but until then I suggest the best thing for restful_authentication would be to qualify the format.any by default. 

@@@ ruby
  def access_denied
    respond_to do |format|
      format.html do
        store_location
        redirect_to new_session_path
      end
      format.any(:js, :xml) do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
@@@

This works well for me in IE and FF without resorting to browser-specific tricks, and if HTTP Auth needs to be invoked by the developer for other situations, they can override as desired.</body>
      <body-html>&lt;div&gt;&lt;p&gt;@mrflip, I think you can actually blame this on a subtle
behaviour of MimeResponds!&lt;/p&gt;
&lt;p&gt;As far as I can see, the problem is that if I use format.any in
a responds_to block, it will always catch unless the other format
options (like format.html) are &lt;em&gt;specifically&lt;/em&gt; preferred by
the browser (i.e. included in the HTTP_ACCEPTS header)&lt;/p&gt;
&lt;p&gt;So using format.html/format.any is fine, as long as the browser
includes text/html in the accepts header.&lt;/p&gt;
&lt;p&gt;IE6 doesn't (and also FF1.5 according to alexendre), but that's
not because its broken. According to the &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&quot; title=&quot;HTTP RFC&quot;&gt;HTTP RFC&lt;/a&gt; there's no compulsion to list the specific
formats you accept.&lt;/p&gt;
&lt;p&gt;I reckon the proper fix to this is in MimeResponds, but until
then I suggest the best thing for restful_authentication would be
to qualify the format.any by default.&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;
  def access_denied
    respond_to do |format|
      format.html do
        store_location
        redirect_to new_session_path
      end
      format.any(:js, :xml) do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works well for me in IE and FF without resorting to
browser-specific tricks, and if HTTP Auth needs to be invoked by
the developer for other situations, they can override as
desired.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-23T07:57:05-05:00</created-at>
      <creator-id type="integer">29039</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">5</number>
      <permalink>using-http-basic-authentication-with-ie-not-working</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">15332</project-id>
      <state>open</state>
      <tag>bug ie windows</tag>
      <title>using http basic authentication with IE - not working</title>
      <updated-at type="datetime">2008-09-23T07:57:10-05:00</updated-at>
      <user-id type="integer">29854</user-id>
      <user-name>Paul Gallagher</user-name>
      <creator-name>Brian Evans</creator-name>
      <url>http://rails_security.lighthouseapp.com/projects/15332/tickets/5</url>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
  </versions>
  <attachments type="array">
    <attachment-image type="Attachment">
      <code>7f39e553e412ab69144d375a330d168e92b210b5</code>
      <content-type>image/png</content-type>
      <created-at type="datetime">2008-08-14T17:38:31-05:00</created-at>
      <filename>login.png</filename>
      <height type="integer">497</height>
      <id type="integer">39340</id>
      <size type="integer">171393</size>
      <uploader-id type="integer">29039</uploader-id>
      <width type="integer">646</width>
      <url>http://rails_security.lighthouseapp.com/attachments/39340/login.png</url>
    </attachment-image>
  </attachments>
</ticket>
